<?php $this->load->view('admin/public/head.html', array('css' => array(
'/assets/admin/css/admin/common.css',
))); ?>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" ng-controller="admin-money-purchaser-history">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            账务管理
            <small>用户账务管理模块</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 后台首页</a></li>
            <li class="active">历史对账单</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">历史对账单</h3>
                        <div class="box-tools"></div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table class="table table-striped">
                            <tr>
                                <th class="text-center" style="width: 50px">#</th>
                                <th class="text-center">时间区间</th>
                                <th class="text-center" style="width: 120px;">总金额</th>
                                <th class="text-center">供应商应得</th>
                                <th class="text-center" style="width: 90px;">订单数量</th>
                                <th class="text-center" style="width: 180px;">收款人</th>
                                <th class="text-center" style="width: 100px;">状态</th>
                                <th class="text-center" style="width: 60px;">操作</th>
                            </tr>
                            <?php if (!empty($data)) foreach($data as $item):?>
                            <tr>
                                <td class="text-center"><?=$item['id']?></td>
                                <td class="text-center"><?=$item['year'] . '年' . $item['month'] . '月'?></td>
                                <td class="text-center"><?=$item['total']?></td>
                                <td class="text-center"><?=$item['left']?></td>
                                <td class="text-center"><?=$item['count']?></td>
                                <td class="text-center"><?=$item['username']?></td>
                                <td class="text-center">
                                    <?php if ($item['status'] == 0):?>
                                        <span style="color: red;">等待审核</span>
                                    <?php elseif($item['status'] == 5):?>
                                        驳回
                                    <?php elseif($item['status'] == 6):?>
                                        <span style="color: green;">已结算</span>
                                    <?php endif;?>
                                </td>
                                <td class="text-center">
                                    <a href="javascript:void(0);" ng-click="cancel(<?=$item['id']?>)">取消</a>
                                </td>
                            </tr>
                            <?php endforeach;?>
                            <?php if (empty($data)):?>
                            <tr>
                                <td colspan="10" class="text-center">
                                    <p class="help-block">暂无对账单记录</p>
                                </td>
                            </tr>
                            <?php endif;?>
                        </table>
                    </div>
                </div>
            </div>

        </div>
    </section>
    <!-- /.content -->
</div>

<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array(
'js' => array(
'/assets/admin/js/money/purchaser/history.js',
)
)); ?>
